package com.it.openfeign.Intercptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

public class feignIntercptor implements RequestInterceptor {

    Logger logger= LoggerFactory.getLogger(this.getClass());

    public void apply(RequestTemplate requestTemplate) {
        // Todo
        //将你不需要的数据拦截下
        requestTemplate.header("token","666");
        requestTemplate.header("xxx","xxx");
        requestTemplate.query("id","111");
        requestTemplate.uri("/9");
        logger.info("feign拦截器！");
    }
}
